<%@ page language="java"  pageEncoding="utf-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Paper,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@ include file="../include/jsp/head.jsp"%>
<%
if(!globa.userSession.hasRight("40010"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
     
%>

<%
    //初始化
    Paper  obj0=null;
    Paper obj=new Paper(globa);
    //查询条件

    String strClassTwoAc = ParamUtil.getString(request,"strClassTwoAc","").trim();
	String tWhere=" where 1=1 ";
	String where = " where 1=1 ";
	String strId = "";
	if(!strClassTwoAc.equals("")){
	 strId = obj.getAcId(" where classTwoAc like '%" + strClassTwoAc + "%'");
	 tWhere += " and acName = '" + strId + "'";
	}
	
	//记录总数
	int intAllCount=obj.getCount(tWhere);	
	//当前页
	int intCurPage=globa.getIntCurPage();
	//每页记录数
	String strPageSize = ParamUtil.getString(request,"strPageSize","10");
    int intPageSize;
    if(strPageSize.equals("所有"))intPageSize = intAllCount;
      else  intPageSize = Integer.parseInt(strPageSize);
	//共有页数
 	int intPageCount=(intAllCount-1)/intPageSize+1;
	// 循环显示一页内的记录 开始序号
	int intStartNum=(intCurPage-1)*intPageSize+1;
	//结束序号
	int intEndNum=intCurPage*intPageSize;   
	//获取到当前页面的记录集

	Vector<Paper> vctObj = null;
	if(strClassTwoAc.equals("")){
	 vctObj=obj.list(where,intStartNum,intPageSize);
	}else{
	if(!strClassTwoAc.equals("")){
	//ArrayList<String>  strId = obj.getAcId(" where classTwoAc like '%" + strClassTwoAc + "%'");
	//vctObj=obj.list3(strId,intStartNum,intPageSize);
	where += " and b.classtwoac like '%" + strClassTwoAc +"%' ";
	vctObj=obj.list4(where,intStartNum,intPageSize);
	//System.out.println(strId+"===============================");
	}
	}
	//获取当前页的记录条数
	int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">
<!--
body {
	background-color: #f2f8ff;
}
.sel1{ width:160px;}
.STYLE1 {color: #FF0000}
.s6 a:link{ line-height:25px;height:25px; color:#333333}
.s6 a:hover{ line-height:25px;height:25px; color:#333333}
-->
</style>
 <link href="../jquerytable/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="../jquerytable/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../jquerytable/Scripts/JQueryPlugin/TableSort.js" type="text/javascript"></script>
    <script language="JavaScript" src="../include/date/popc.js"></script>
	<script src="../include/js/list.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#tb").sorttable({
                ascImgUrl: "../jquerytable/Images/bullet_arrow_up.png",
                descImgUrl: "../jquerytable/Images/bullet_arrow_down.png",
                ascImgSize: "8px",
                descImgSize: "8px",
                sorttingMsg: "数据加载中...",
                sorttingMsgColor: "#FF6600",
                 maskOpacity: "0.6",
                 maskColor:"#D2F1FF",
                onSorted: function (cell) {
                  //  alert(cell.index() + " -- " + cell.text());
                }
            });
        });
    </script>
<script type="text/javascript">

 function showAc(){ 
  frm.action="paper_list.jsp";
  // document.getElementById(<%=Constants.PAGE_SIZE_INDEX%>).value = "1"; //chrome浏览器不兼容。。
  frm.<%=com.ejoysoft.common.Constants.PAGE_SIZE_INDEX%>.value = "1";
 
  frm.submit();
 }


  function export_sbm(page){ 
  frm.action="paper_export.jsp";
  document.getElementById("strCurPage").value = "<%=intCurPage%>";
  document.getElementById("exportContent").value = page;
  frm.submit();
 }
 function alertnull()
 {
 alert("该二级热点还没有图纸！！！");
 }
</script>

</head>


<body>

<form name="frm"  action="paper_list.jsp"method="post">
<input type="hidden" name="<%=Constants.ACTION_TYPE%>" value="<%=Constants.DELETE_STR%>" />
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="bottom" />&nbsp;您现在所在的位置：<font color="#0e7cc9">首页</font> &gt; 图纸管理</td>
  </tr>
</table>
<table id="tb" width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
  	<td align="right"  style="font-size: 13px">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin:10px 0px 2px 0px;">
       <tr>
        <td height="45" valign="middle" bgcolor="e1eef7">
      <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td align="right" style="font-size: 15px" width="97%">
		      <strong>二级热点</strong> <input name="strClassTwoAc" style="height: 15px;font-size: 14px" value="<%=strClassTwoAc %>" size="20" />
		</td>
		<td  align="center" style="width:70px ;padding-bottom: 0px"><img src="../images/search.jpg"  onclick="showAc()" /></td>
         </tr>
      </table></td>
	     </tr>
       </table> </td></tr>
  </table>      
  <table id="tb" width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr role="head">
     
        <td sort="true" width="10%" height="25" class="listtit"><strong>城市</strong></td>
        <td sort="true" width="12%"  class="listtit"><strong>区县</strong></td>
        <td sort="true" width="22%" class="listtit"><strong>一级热点</strong></td>
        <td sort="true" width="22%"  class="listtit"><strong>二级热点</strong></td>
         <td width="%"  class="listtit"><strong>拓扑定位</strong></td>
          <td width="%"  class="listtit"><strong>修改</strong></td>
           <td width="%"  class="listtit"><strong>删除</strong></td>
      </tr>
      <%
            for (int i = 0;i < vctObj.size(); i++) {
            	Paper obj1 = vctObj.get(i);  
            	int papernumber = obj1.getPaperNum(" where acname = '"+obj1.getAcName()+"'");     
            %>
			      <tr>
			        
			        <td height="25" align="center" class="listd1" style="border-left:1px solid #dddddd;"><%=obj1.getStrCity() %></td>
			        <td align="center" class="listd1"><%=obj1.getStrCountry() %></td>
			        <td align="center" class="listd1"><%=obj1.getClssOneAc() %></td>
			        <td align="center" class="listd1"><%=obj1.getClssTwoAc() %></td>
					 <td align="center"class="listdrd">
			        	  <a href="#" onclick="<%if( papernumber==0){ %>alertnull()<%} %><%else{ %>window.parent.leftFrame.location='../left.jsp?actionFlag=拓扑呈现&rootFlag=日常管理';window.parent.mainFrame.location='../topology/topology_show.jsp?classTwoACName=<%=obj1.getAcName() %>';<%}%>"><img src="../images/map_blue.png" height="20" border="0" /></a>
			              </td>
			        <td align="center" class="listdrd" >
			        	 <a  href="paper_update.jsp?strHotSpotId=<%=obj1.getAcName()%>"><img src="../images/mid.jpg" height="14" border="0" /></a> 
			     		</td>
			        <td align="center"class="listdrd" style="border-right:1px solid #dddddd;">
			        	 <a  href="#" onclick="if(confirm('确认删除该记录？')){location.href='paper_act.jsp?<%=Constants.ACTION_TYPE%>=<%=Constants.DELETE_STR%>&strId=<%=obj1.getAcName() %>';}"><img src="../images/del.jpg" height="14" border="0" /></a> 	
			        </td>
                                      
			      </tr>      
        <%
            }//for
         %> 
    </table>
    <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="61%" height="50" valign="bottom"><!--<img src="../images/pldel.jpg" width="83" height="27" align="absmiddle" />--> &nbsp;&nbsp;页面记录数
      <select name="strPageSize" id="strPageSize" style="width:52px;" onchange="showAc()">
		<% 
		 String sltOpt[] = {"10","20","30","50","70","100","所有"};
		 for(int i=0; i < sltOpt.length;i++){
		 	String selected = "";
		    if(sltOpt[i].equals(strPageSize))
		      selected="selected='selected'";
		 %>
		 <option value="<%=sltOpt[i] %>" <%=selected %>><%=sltOpt[i] %></option>
   		<%
   		 }
   		 %>
   		 </select>
      <img src="../images/dc.jpg" width="92" height="27" align="middle" onclick="export_sbm('currentPage')"/> <img src="../images/dcall.jpg" width="82" height="27" align="absmiddle" onclick="export_sbm('allPage')" />&nbsp;&nbsp;</td>
		 <td>  <input id="exportFlag" name="exportFlag" type="hidden" value="exportResult"/>
       		 <input id="strCurPage" name="strCurPage" type="hidden" value=""/>
			<input id="exportContent" name="exportContent" type="hidden" value=""/></td>	
    
      <td width="39%" align="right" valign="bottom"><!--<table width="310" border="0" cellspacing="0" cellpadding="0">
       <tr>
        <td width="40"><img src="../images/up.jpg" width="40" height="30" /></td>
        <td width="221" align="center" background="../images/page_bg.jpg" class="page"><a href="#">1</a>&nbsp; <a href="#">2</a>&nbsp; <a href="#">3</a>&nbsp; <a href="#"><span class="sel">4</span></a>&nbsp; <a href="#">5</a> &nbsp;<a href="#">6</a> &nbsp;<a href="#">7</a>&nbsp; <a href="#">8 </a>&nbsp;<a href="#">9</a>&nbsp;...&nbsp;<a href="#">13</a> </td>
        <td width="39"><img src="../images/down.jpg" width="39" height="30" /></td>
       </tr>
    </table>
  -->
  <!-- 翻页开始 -->  
     	<%@ include file="../include/jsp/cpage.jsp"%>
       	<!-- 翻页结束 --> </td>
  </tr>
</table>
    	 
<p><br />
</p>
    </form>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>